package com.geek.plugin;

import java.lang.reflect.Method;

import org.springframework.aop.MethodBeforeAdvice;

/**
 * 方法运行统计Plugin
 * @author lenovo
 *
 */
@SuppressWarnings("serial")
public class MethodCounterPlugin extends MethodCounter implements MethodBeforeAdvice{

	@Override
	public void before(Method method, Object[] args, Object target) throws Throwable {
		count(method);
		System.out.println(String.format("方法%s 执行次数%s", method.getName(), getCalls()));
	}

}
